package task

import (
	"fmt"
	"github.com/bamzi/jobrunner"
	"zorm-learn/app/util"
)

type Task struct {
}

func (job *Task) Run() {
	myTask()
}
func myTask() {
	fmt.Println("Task is being executed!")
}

func RunScheduleTask(config *util.TaskConfig) {
	if config.Enable {
		jobrunner.Start()
		jobrunner.Schedule(config.Cron, &Task{})
	}
}
